package com.bluedot.bank.dao.role;

import java.util.List;

import org.hibernate.Query;

import com.bluedot.bank.dao.HibernateDaoSupport;
import com.bluedot.bank.dao.Pagination;
import com.bluedot.bank.dao.customer.CustomerConditons;



public class RoleDaoImpl extends HibernateDaoSupport<Role, Long> implements RoleDao {

	public RoleDaoImpl(){
		this.entityClass=Role.class;
	}
@Override
public void browse(Pagination<Role> pagination) {
	CustomerConditons f=(CustomerConditons)pagination.getConditon();
	if(f!=null)
	{
		this.getSession().enableFilter(f.getFilterName()).setParameter(f.getKey(), f.getO());
	}
	super.browse(pagination);
}
@Override
public List<Role> getAll() {
	Query query =this.getSession().createQuery("from " + Role.class.getName());
	List<Role> list=query.list();
	return list;
}
}
